-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotation API: fix __experimentalGetPropsForEditableTreePreparation #42596
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hm, I do notice another problem though. Multi select stopped working. |
Size Change: +114 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
ellatrix
commented
Jul 21, 2022
{ blockClientId } | ||
) { | ||
return { | ||
carets: select( 'core/block-editor' ).getBlockName( blockClientId ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For testing purposes.
ellatrix
changed the title
[Ignore] Test Annotation API problem
Annotation API: fix __experimentalGetPropsForEditableTreePreparation
Jul 21, 2022
Tests are passing, so that means the format is no longer causing any issues. |
@msurdi Could you approve this PR if it works for you? |
msurdi
approved these changes
Jul 26, 2022
Mamaduka
added
[Type] Bug
An existing feature does not function as intended
[Feature] Rich Text
Related to the Rich Text component that allows developers to render a contenteditable
labels
Jul 27, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Rich Text
Related to the Rich Text component that allows developers to render a contenteditable
[Type] Bug
An existing feature does not function as intended
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Fixes #23428.
When
__experimentalGetPropsForEditableTreePreparation
returns an object with multiple keys, the object itself is not a stable key that can be in turn returned as a key withuseSelect
.In other words, this ends up being passed to
useSelect
, which will cause excessive rerenders:Solution: flatten the tree to:
So that
useSelect
can do its shallow equal magic.Why?
How?
Testing Instructions
See #23428. Create a format that subscribes to the block editor store:
#23428 (comment)
Screenshots or screencast